package com.hksj.Intelligentmanagement.mqtt.listener;

import com.hksj.Intelligentmanagement.mqtt.annotation.MqttSubscription;
import com.hksj.Intelligentmanagement.mqtt.constant.TopicConstant;
import org.eclipse.paho.client.mqttv3.MqttMessage;

@MqttSubscription(topics = {TopicConstant.GATEWAY_MQTT_MESSAGE})
public class GatewayMessageListener extends ListenerMqttClientSupport implements MqttListener{

    //订阅该消息后接收到网关发消息的收到业务实现
    @Override
    public void receive(String topic, MqttMessage mqttMessage) {


        System.out.println("从==>" + topic +"这个topic" + "发送了消息==>"+ mqttMessage);
    }
}
